package drinkkiosk.drinks;

import drinkkiosk.CardPanel;
import drinkkiosk.cards.CustomCard;
import drinkkiosk.cards.SpecialsCard;
import javax.swing.JComboBox;
import javax.swing.JLayeredPane;
import javax.swing.JPanel;

/**AddCustomPanel is a JPanel with multiple ComboBoxes for creating a CustomDrink.
 * As the Patron chooses from the drop-down menus, the CustomDrink object is
 * changed to meet the Patron's preferences.
 * @author Charles Ritchea
 */
public class AddCustomPanel extends javax.swing.JPanel {
	/**The Custom Drink*/
	private SpecialDrink drink;
        private CardPanel cardPanel;
        private CustomCard customCard;
        private JLayeredPane layeredPane;
        private SpecialsCard specialsCard;
	/**Drink Getter
	 * @return Drink
	 */
	public SpecialDrink getDrink() {
		return drink;
	}
	/**AddCustomPanel creates a new Drink with empty fields
	 */
	public AddCustomPanel() {
		drink = new SpecialDrink("custom","","","","","","","");
		initComponents();
                
	}

	/** This method is called from within the constructor to
	 * initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is
	 * always regenerated by the Form Editor.
	 */
	@SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        LiquorComboBox = new javax.swing.JComboBox();
        jLabel1 = new javax.swing.JLabel();
        LiqueurComboBox = new javax.swing.JComboBox();
        jLabel2 = new javax.swing.JLabel();
        NonAlcoholicComboBox = new javax.swing.JComboBox();
        jLabel3 = new javax.swing.JLabel();
        GarnishComboBox = new javax.swing.JComboBox();
        jLabel4 = new javax.swing.JLabel();
        BarwareComboBox = new javax.swing.JComboBox();
        jLabel5 = new javax.swing.JLabel();
        TemperatureComboBox = new javax.swing.JComboBox();
        jLabel6 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();

        setBackground(new java.awt.Color(255, 255, 255));

        LiquorComboBox.setFont(new java.awt.Font("Arial", 0, 24));
        LiquorComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "None", "Vodka", "Gin", "Light Rum", "Tequila", "Bourbon", "Whiskey", "Scotch", "Spiced Rum", "Black Rum", "Brandy", "Cognac" }));
        LiquorComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                LiquorComboBoxActionPerformed(evt);
            }
        });

        jLabel1.setFont(new java.awt.Font("Arial", 0, 24));
        jLabel1.setText("Liquor");

        LiqueurComboBox.setFont(new java.awt.Font("Arial", 0, 24));
        LiqueurComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "None", "Triple-sec", "Sweet Vermouth", "Dry Vermouth", "Blue Curacao", "Peach", "Apple", "Peppermint", "Amaretto", "Hazelnut", "Irish Cream", "Kahlua", "Galliano", " " }));
        LiqueurComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                LiqueurComboBoxActionPerformed(evt);
            }
        });

        jLabel2.setFont(new java.awt.Font("Arial", 0, 24));
        jLabel2.setText("Liqueuer");

        NonAlcoholicComboBox.setFont(new java.awt.Font("Arial", 0, 24));
        NonAlcoholicComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "None", "Cold Water", "Hot Water", "Cola", "Seltzer", "Tonic", "Lemonade", "Lemon-lime", "Milk", "Eggnog", "Redbull", "Orange Juice", "Pineapple Juice", "Tea", "Coffee", "Tomato Juice", "Clamato", "Sourmix", " " }));
        NonAlcoholicComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                NonAlcoholicComboBoxActionPerformed(evt);
            }
        });

        jLabel3.setFont(new java.awt.Font("Arial", 0, 24));
        jLabel3.setText("Non-Alcoholic");

        GarnishComboBox.setFont(new java.awt.Font("Arial", 0, 24));
        GarnishComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "None", "Olive", "Pearl Onion", "Lemon", "Lime", "Orange", "Cherry", "Celery", "Salt", "Nutmeg" }));
        GarnishComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                GarnishComboBoxActionPerformed(evt);
            }
        });

        jLabel4.setFont(new java.awt.Font("Arial", 0, 24));
        jLabel4.setText("Garnish");

        BarwareComboBox.setFont(new java.awt.Font("Arial", 0, 24));
        BarwareComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Old Fashioned", "Chimney", "Martini", "Shot", "Mug", "Skull" }));
        BarwareComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BarwareComboBoxActionPerformed(evt);
            }
        });

        jLabel5.setFont(new java.awt.Font("Arial", 0, 24));
        jLabel5.setText("Barware");

        TemperatureComboBox.setFont(new java.awt.Font("Arial", 0, 24));
        TemperatureComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Room", "Iced", "Frozen", "Hot" }));
        TemperatureComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                TemperatureComboBoxActionPerformed(evt);
            }
        });

        jLabel6.setFont(new java.awt.Font("Arial", 0, 24));
        jLabel6.setText("Temperature");

        jLabel8.setFont(new java.awt.Font("Arial", 0, 24));
        jLabel8.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel8.setText("Design a Custom Drink Order");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel8, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 435, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 148, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel4)
                            .addComponent(jLabel5))
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(NonAlcoholicComboBox, 0, 269, Short.MAX_VALUE)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addComponent(BarwareComboBox, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(GarnishComboBox, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 268, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                            .addComponent(jLabel2)
                            .addGap(72, 72, 72)
                            .addComponent(LiqueurComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                            .addComponent(jLabel1)
                            .addGap(99, 99, 99)
                            .addComponent(LiquorComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 269, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(1, 1, 1)
                        .addComponent(jLabel6)
                        .addGap(28, 28, 28)
                        .addComponent(TemperatureComboBox, 0, 269, Short.MAX_VALUE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel8)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(LiquorComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(LiqueurComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(NonAlcoholicComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel3))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(GarnishComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel4))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(BarwareComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel5))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(TemperatureComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6))
                .addContainerGap(24, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents
	/**When the Patron changes LiquorComboBox the Drink is changed to match
	 * @param evt ActionEvent the event of LiquorComboBox being changed 
	 */
	private void LiquorComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_LiquorComboBoxActionPerformed
		JComboBox comboBox = (JComboBox)evt.getSource();
		drink.setLiquor(comboBox.getSelectedItem().toString());
                layeredPane = (JLayeredPane) getParent();
                customCard = (CustomCard) layeredPane.getParent();
                cardPanel = (CardPanel) customCard.getParent();
                specialsCard = (SpecialsCard) cardPanel.getSpecialsCard();
                specialsCard.setSpecial(drink);
	}//GEN-LAST:event_LiquorComboBoxActionPerformed
	/**When the Patron changes LiqueurComboBox the Drink is changed to match
	 * @param evt ActionEvent the event of LiqueurComboBox being changed 
	 */
	private void LiqueurComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_LiqueurComboBoxActionPerformed
		JComboBox comboBox = (JComboBox)evt.getSource();
		drink.setLiqueur(comboBox.getSelectedItem().toString());
                layeredPane = (JLayeredPane) getParent();
                customCard = (CustomCard) layeredPane.getParent();
                cardPanel = (CardPanel) customCard.getParent();
                specialsCard = (SpecialsCard) cardPanel.getSpecialsCard();
                specialsCard.setSpecial(drink);
	}//GEN-LAST:event_LiqueurComboBoxActionPerformed
	/**When the Patron changes NonAlcoholicComboBox the Drink is changed to match
	 * @param evt ActionEvent the event of NonAlcoholicComboBox being changed 
	 */
	private void NonAlcoholicComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_NonAlcoholicComboBoxActionPerformed
		JComboBox comboBox = (JComboBox)evt.getSource();
		drink.setNonalcoholic(comboBox.getSelectedItem().toString());
                layeredPane = (JLayeredPane) getParent();
                customCard = (CustomCard) layeredPane.getParent();
                cardPanel = (CardPanel) customCard.getParent();
                specialsCard = (SpecialsCard) cardPanel.getSpecialsCard();
                specialsCard.setSpecial(drink);
	}//GEN-LAST:event_NonAlcoholicComboBoxActionPerformed
	/**When the Patron changes GarnishComboBox the Drink is changed to match
	 * @param evt ActionEvent the event of GarnishComboBox being changed 
	 */
	private void GarnishComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_GarnishComboBoxActionPerformed
		JComboBox comboBox = (JComboBox)evt.getSource();
		drink.setGarnish(comboBox.getSelectedItem().toString());
                layeredPane = (JLayeredPane) getParent();
                customCard = (CustomCard) layeredPane.getParent();
                cardPanel = (CardPanel) customCard.getParent();
                specialsCard = (SpecialsCard) cardPanel.getSpecialsCard();
                specialsCard.setSpecial(drink);
	}//GEN-LAST:event_GarnishComboBoxActionPerformed
	/**When the Patron changes BarwareComboBox the Drink is changed to match
	 * @param evt ActionEvent the event of BarwareComboBox being changed 
	 */
	private void BarwareComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BarwareComboBoxActionPerformed
		JComboBox comboBox = (JComboBox)evt.getSource();
		drink.setBarware(comboBox.getSelectedItem().toString());
                layeredPane = (JLayeredPane) getParent();
                customCard = (CustomCard) layeredPane.getParent();
                cardPanel = (CardPanel) customCard.getParent();
                specialsCard = (SpecialsCard) cardPanel.getSpecialsCard();
                specialsCard.setSpecial(drink);
	}//GEN-LAST:event_BarwareComboBoxActionPerformed
	/**When the Patron changes TemperatureComboBox the Drink is changed to match
	 * @param evt ActionEvent the event of TemperatureComboBox being changed 
	 */
	private void TemperatureComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TemperatureComboBoxActionPerformed
		JComboBox comboBox = (JComboBox)evt.getSource();
		drink.setTemperature(comboBox.getSelectedItem().toString());
                layeredPane = (JLayeredPane) getParent();
                customCard = (CustomCard) layeredPane.getParent();
                cardPanel = (CardPanel) customCard.getParent();
                specialsCard = (SpecialsCard) cardPanel.getSpecialsCard();
                specialsCard.setSpecial(drink);
	}//GEN-LAST:event_TemperatureComboBoxActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JComboBox BarwareComboBox;
    private javax.swing.JComboBox GarnishComboBox;
    private javax.swing.JComboBox LiqueurComboBox;
    private javax.swing.JComboBox LiquorComboBox;
    private javax.swing.JComboBox NonAlcoholicComboBox;
    private javax.swing.JComboBox TemperatureComboBox;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel8;
    // End of variables declaration//GEN-END:variables
}
